// 新建 echarts.js 或 plugins/echarts.js
import ECharts from 'vue-echarts'
import { use } from 'echarts/core'
import { CanvasRenderer } from 'echarts/renderers'
import { BarChart, LineChart, PieChart } from 'echarts/charts'
import {
  GridComponent,
  TooltipComponent,
  LegendComponent,
  TitleComponent,
  DatasetComponent
} from 'echarts/components'

export default {
  install(app) {
    use([
      CanvasRenderer,
      BarChart,
      LineChart,
      PieChart,
      GridComponent,
      TooltipComponent,
      LegendComponent,
      TitleComponent,
      DatasetComponent
    ])

    app.component('v-chart', ECharts)
  }
}
